<?php /* Smarty version 2.6.18, created on 2016-12-09 10:19:14
         compiled from absent/absent.add.tpl.php */ ?>
﻿<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.header.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.left.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
		      <form action="" method="post">
                <div class="box-header with-border">
                    <span class="fa fa-table" style="float:left; font-size:18px; margin-top:2px; color:#3c8dbc;" ></span>
                    <p class="box-title">代课安排</p>
                </div>
                    <div class="box-body" id="staff_subject">
					    <div class="form-group">
							  <label for="inputPassword3" class="col-md-3 control-label text-right" >
								   班级名称：
							  </label>
							  <div class="input-group col-md-6 col-sm-12 col-xs-12">
								    <select class="form-control first select" name="class_id" id="classid">
										<option value=""> 请选择</option>
									
								    </select> 
							  </div> 
				        </div>
                        <div class="form-group">
							  <label for="inputPassword3" class="col-md-3 control-label text-right" >
								   学科名称：
							  </label>
							  <div class="input-group col-md-6 col-sm-12 col-xs-12">
								    <select class="form-control second select" name="from_subject" id="discipline">
										<option value=""> 请选择</option>
										
								    </select> 
							  </div> 
				        </div>
						<div class="form-group">
							  <label for="inputPassword3" class="col-md-3 control-label text-right" >
								   原科任：
							  </label>
							  <div class="input-group col-md-6 col-sm-12 col-xs-12">
								    <select class="form-control third select" name="from_staff" id="teacher">
										<option value=""> 请选择</option>
										
								    </select> 
							  </div> 
				        </div>
						<div class="form-group">
							  <label for="inputPassword3" class="col-md-3 control-label text-right" >
								   选择星期节数：
							  </label>
							  <div class="input-group col-md-6 col-sm-12 col-xs-12">
                               <!--	 <span class="tt form-control" data-toggle="modal" data-target="#myModal"></span>-->
                               <input type="text" value="" name="" id="tt"  class="form-control" data-toggle="modal" data-target="#myModal" onClick="show()">
							   <input type="hidden" class="form-control" id="hid" name="absent_section" value="" >
							  </div> 
				        </div>
						<div class="form-group">
							  <label for="inputPassword3" class="col-md-3 control-label text-right" >
								   开始日期：
							  </label>
							  <div class="input-group col-md-6 col-sm-12 col-xs-12">
								    <input type="text" class="form-control" name="start_time" value="" id="start">
									<div class="input-group-addon">
									     <i class="fa fa-calendar"></i>
									</div>
							  </div> 
				        </div>
						<div class="form-group">
							  <label for="inputPassword3" class="col-md-3 control-label text-right" >
								   结束日期：
							  </label>
							  <div class="input-group col-md-6 col-sm-12 col-xs-12">
								    <input type="text" class="form-control" name="end_time" value="" id="end">
									<div class="input-group-addon">
									     <i class="fa fa-calendar"></i>
									</div>
							  </div> 
				        </div>						
						<div class="form-group">
							  <label for="inputPassword3" class="col-md-3 control-label text-right" >
								   代理学科：
							  </label>
							  <div class="input-group col-md-6 col-sm-12 col-xs-12">
								    <select class="form-control" name="to_subject">
										<?php $_from = $this->_tpl_vars['subject_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
										<option value="<?php echo $this->_tpl_vars['value']['subject_id']; ?>
"> <?php echo $this->_tpl_vars['value']['subject_name']; ?>
</option>
										<?php endforeach; endif; unset($_from); ?>
								    </select> 
							  </div> 
				        </div>
						<div class="form-group">
							  <label for="inputPassword3" class="col-md-3 control-label text-right" >
								   代课老师：
							  </label>
							  <div class="input-group col-md-6 col-sm-12 col-xs-12">
								    <select class="form-control" name="to_staff">
										<?php $_from = $this->_tpl_vars['staff_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
										<option value="<?php echo $this->_tpl_vars['value']['staff_id']; ?>
"> <?php echo $this->_tpl_vars['value']['staff_name']; ?>
</option>
										<?php endforeach; endif; unset($_from); ?>
								    </select> 
							  </div> 
				        </div>
						<div class="form-group">
							  <label for="inputPassword3" class="col-md-3 control-label text-right" >
								   请假原因：
							  </label>
							  <div class="input-group col-md-6 col-sm-12 col-xs-12">
							       <?php $_from = $this->_tpl_vars['free_ini']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
								   <label class="choice"><input type="radio" name="absent_item" value="<?php echo $this->_tpl_vars['key']; ?>
"><?php echo $this->_tpl_vars['value']; ?>
</label>
								   <?php endforeach; endif; unset($_from); ?>
							  </div> 
				        </div>
						<div class="form-group">
							  <label for="inputPassword3" class="col-md-3 control-label text-right" >
								   备注：
							  </label>
							  <div class="input-group col-md-6 col-sm-12 col-xs-12">
								    <textarea class="form-control" rows="3" name="absent_note"></textarea>
							  </div> 
				        </div>	 
				    </div><!--box-body -->
					<div class="box-footer text-center">
				        <button type="submit" class="btn btn-primary"> 确 定 </button>					  
				    </div>
				</form>
             </div><!--box box-default box-solid-->
        </section>   
           
        </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
<!--弹出框-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                  <div class="modal-dialog" role="document">
                    <div class="modal-content">
                      
                          <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel">老师课程表</h4>
                          </div>
                          <div class="modal-body" id="syllabus_form">
							请选择原科任教师
                          </div>
                          <div class="modal-footer">
                            <button type="submit" class="btn btn-primary" id="teacher_submit"  onclick="getInfo()">确定</button>
                          </div>
                    </div>
                  </div>
                </div>
                <!--弹出框-->
 <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.footer.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<script src="static/js/jquery-ui-timepicker-addon.js"></script>
<script src="static/js/jquery.cxselect.min.js"></script>
 <script>
  $(function() {
    $( "#start" ).datetimepicker({
      timeFormat: 'HH:mm:ss',
	  showMinute: true,
    });
	 $( "#end" ).datetimepicker({
      timeFormat: 'HH:mm:ss',
	  showMinute: true,
    });
  });
  </script>

  
  <script type="text/javascript">
    
  function show(){
	         	
		    var timesmap = new Date();	 
			var class_id = $("#classid").val();		  
			var subject_id = $("#discipline").val();						   
			var staff_id = $("#teacher").val();				   
				   						   
			$.ajax({
			url:"index.php?a=syllabus.absenthtml&class_id="+class_id+"&subject_id="+subject_id+"&staff_id="+staff_id+"&timesmap="+timesmap,
			type:"get",
			//data: $("."+c+":selected").length,
			dataType:"html",
			success:function(msg){
     			 $("#syllabus_form").html(msg); 
				 		                          		   
			    }
            });

     }
  
  </script>
<script type="text/javascript">
   
        function getInfo(){  
            
            var chk_value =[];
  
            $('input[name="xuan[]"]:checked').each(function(){ 
            chk_value.push($(this).val());
		 
            });  
		 
           $('#hid').val(chk_value); 
		   
		   
		     var ht_value=[];
			 
			 $('input[name="xuan[]"]:checked').each(function(){
				 
				// ht_value.push($(this).next().text());获取html的值
				ht_value.push($(this).val());
				 
				 });
				 
				 $('#tt').val(ht_value);
		   
		   
		   
		   
         
           $('#myModal').modal('hide');
        }  
    
	
  </script>
<script>
$.cxSelect.defaults.url = 'index.php?a=staff.subjectjson';

$('#staff_subject').cxSelect({
  selects: ['first', 'second', 'third'],
  jsonName: 'n', //传回JSON时要应用的option名字  
  jsonValue: 'v', //传回JSON时要应用的option值  
  //jsonSpace: 'data',//传回JSON时要应用的命名空间，例如传回来"data":['value':0,'name':1]
});

</script>
           